package mylittleinvestigations.Collisions;

import mylittleinvestigations.Vector2;

public class OverlapEntry
{
    public float OverlapDistance;
    public Vector2 OverlapAxis;
    public CollidableObject CollidableObject1;
    public CollidableObject CollidableObject2;

    @Override
    public boolean equals(Object obj)
    {
        if (!(obj instanceof OverlapEntry))
        {
            return false;
        }
                
        OverlapEntry overlapEntry = (OverlapEntry)obj;

        if (overlapEntry == null)
        {
            return false;
        }

        return
            (this.CollidableObject1 == overlapEntry.CollidableObject1 && this.CollidableObject2 == overlapEntry.CollidableObject2) ||
            (this.CollidableObject1 == overlapEntry.CollidableObject2 && this.CollidableObject1 == overlapEntry.CollidableObject2);
    }

    @Override
    public int hashCode()
    {
        return this.CollidableObject1.hashCode() ^ this.CollidableObject2.hashCode();
    }
}
